package com.linked.basemanage.pass.bean.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linked.basemanage.pass.bean.param.AddPassInfoParam;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author :dbq
 * @date : 2023/3/24 14:51
 * @description : desc
 */
@Data
@TableName("basemanage_pass_info")
public class PassInfoPO {
    @TableId(value = "pass_id", type = IdType.ASSIGN_UUID)
    private String passId;
    @TableField("user_id")
    private String userId;
    @TableField("name")
    private String name;
    @TableField("ip_addr")
    private String ipAddr;
    @TableField("pass_type")
    private Integer passType;
    @TableField("remarks")
    private String remarks;
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @TableField("data_status")
    private Integer dataStatus;

    public PassInfoPO(AddPassInfoParam param) {
        this.userId = param.getUserId();
        this.name = param.getName();
        this.ipAddr = param.getIpAddr();
        this.passType = param.getPassType();
        this.remarks = param.getRemarks();
    }
}
